Repository navigation
gh-11732: Resync compact mode state when the sidebar observer reconnects - #17029
Merged
mr-cheffy merged 2 commits intoDec 5, 2026
Merged
Conversation
zen-compact-mode-active could stay set on the sidebar after a panel closed while compact mode was off, keeping the sidebar visible after re-enabling compact mode.
mr-cheffy
requested changes
Dec 5, 2026
| ? observer.attributeFilter | ||
| : undefined, | ||
| }); | ||
| // The state attribute may be stale: it can be set while the observer |
Member
|
/approve |
This was
linked to
issues
Dec 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In compact mode the sidebar can stay visible and stop auto-hiding until Zen is restarted (#11732, possibly #16896).
Cause:
#navigator-toolboxkeeps a stalezen-compact-mode-active. The attribute is maintained by theZenHasPolyfillobserver, butZenCompactModedisconnects that observer while compact mode is off. If a panel anchored in the sidebar closes in that window (or compact mode is turned off with it open), the attribute is never removed. Turning compact mode back on reconnects the observer, butconnectObserverdoesn't evaluate the current state, so the stale attribute stays until some unrelated[open]/[panelopen]mutation happens in the sidebar. That's also why toggling compact mode off and on doesn't help.Fix:
connectObservernow runs the observer'supdateStateright afterobserve(), so the attribute matches the DOM as soon as the observer is reconnected.Tested on 1.24.3b (macOS) with the change applied to omni.ja:
zen-compact-mode-active="true"with no open panel, and the sidebar stayed visible after Cmd+S. Removing the attribute by hand hid it.